package bfh.fbi.mobiComp.integrator.definition;

/**
 * In order to get accurate data (over time) from a 'pure' sensor, an integrator
 * should be used. This integrator acts as a LowPassFilter, that cancels out the
 * intrinsic noise of the sensor. The frequency is defined as the time between
 * two samples with different amplitude. The amplitude is defined as the value
 * per sample.
 *
 * @author Quantasy
 *
 */
public interface Integrator {

	/**
	 *
	 * @param maxNoiseError
	 *            is equal to the max amplitude of the filter which has to be
	 *            represented by a positive value.
	 * @throws IntegratorException
	 *             If the value is not within the expected range
	 */
	public abstract void setMaxNoiseError(final double maxNoiseError)
			throws Exception;

	/**
	 * @param value
	 *            amplitude of the Sample
	 */
	public abstract void addSample(final double value);


	/**
	 * Clears the sampleSet used for the integration
	 */
	public abstract void clear();

	/**
	 * Calculates the integration over the used sampleSet
	 *
	 * @return
	 */
	public abstract double getAverage();

}
